﻿using sipfe.model.dataAccess;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace sipfe.model.helper
{
   public class HelperDAO
    {
       private BDSIPFEEntities db = new BDSIPFEEntities();

       public int validaDestinosDAO(string vDestinos)
       {
           int cant = 0;
           int rpta = 1;
           String[] arrayDestino = vDestinos.Split(',');
           foreach (string pkDep in arrayDestino)
           {
               int idDestino = Int32.Parse(pkDep);
               cant = db.SIPMaeDependencia.Where(s => s.nIdeDep == idDestino).Count();
               if (cant <= 0)
               {
                   rpta = 0;
                   break;
               }
           }
           return rpta;
       }

       



    }
}
